﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BattleThis.Core;

namespace BattleThis.Helpers
{
	public static class ViewExtension
	{
		public static GameContext GetGameContext<TModel>( this WebViewPage<TModel> view )
		{
			return view.ViewContext.HttpContext.GetGameContext();
		}

		public static bool HasUnit( this WebViewPage<Field> view )
		{
			return !view.Model.Unit.IsEmpty();
		}
	}
}